package com.jymj.enumEntity;

import com.jymj.entity.Analysis.RjhjzgtjEntity;
import com.jymj.entity.landmanage.ScoreZhenEntity;
import lombok.Getter;


/**
 * @author Lzh
 * @date 2021/3/30 16:23
 */
@Getter
public enum JsonTypeEnum {
    two(ScoreZhenEntity.class, 2),
    three(RjhjzgtjEntity.class,3);


    // 成员变量
    private Class object;
    private Integer type;

    // 构造方法
    JsonTypeEnum (Class object, int type) {
        this.object = object;
        this.type = type;
    }

    public static Class getObject(int type) {
        for (JsonTypeEnum s : JsonTypeEnum.values()) {
            if (s.getType() == type) {
                return s.object;
            }
        }
        return null;
    }
}
